package com.liang.blog.reception.mapper;

import com.liang.blog.model.BlogArticle;
import com.liang.blog.vo.article.ArticleInfoVo;
import com.liang.blog.vo.article.BlobCommentsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author：YanWenLiang
 * @Date:2023-09-20-8:51
 */
@Mapper
public interface BlogArticleMapper {

    /**
     * 添加博客内容
     * @param blogArticle
     * @return
     */
    int insertArticle(BlogArticle blogArticle);

    /**
     * 通过id获取相应的文章
     * @return
     */
    ArticleInfoVo getArticleById(Long id);

    /**
     * 添加文章
     * @param articleInfoVo
     * @return
     */
    Boolean addArticle(ArticleInfoVo articleInfoVo);

    /**
     * 获取文章
     * @param articleInfoVo
     * @return
     */
    List<ArticleInfoVo> getArticleList(ArticleInfoVo articleInfoVo);

    /**
     * 添加文章浏览量
     * @param id
     */
    void updateArticlePageView(Long id);

    /**
     * 添加评论
     * @return
     */
    Integer addArticleComments(BlobCommentsVO blobCommentsVO);

    /**
     * 根据文章id获取相关评论
     * @param articleId
     */
    List<BlobCommentsVO> getArticleComments(Long articleId);

    Integer deleteByIds(@Param("idList") List<String> idList);
}
